using System;
using System.Collections.Generic;
using System.Text;

namespace GAControl
{
    public class Item
    {
        private string _sKU, _name, _category;
        private int _quantity;
        private decimal _price;

        /// <summary>
        /// Product SKU code
        /// </summary>
        public string SKU
        {
            get { return _sKU; }
            set { _sKU = value; }
        }
        /// <summary>
        /// Product name or description
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        /// <summary>
        /// Category of the product or variation
        /// </summary>
        public string Category
        {
            get { return _category; }
            set { _category = value; }
        }
        /// <summary>
        /// Unit-price of the product
        /// </summary>
        public decimal Price
        {
            get { return _price; }
            set { _price = value; }
        }
        /// <summary>
        /// Quantity ordered
        /// </summary>
        public int Quantity
        {
            get { return _quantity; }
            set { _quantity = value; }
        }

        public Item(string _SKU, string _Name, string _Category, decimal _Price, int _Quantity)
        {
            SKU = _SKU;
            Name = _Name;
            Category = _Category;
            Price = _Price;
            Quantity = _Quantity;
        }

        internal string GetLine(string orderId)
        {
            return string.Format("UTM:I|{0}|{1}|{2}|{3}|{4}|{5}\r\n", orderId, SKU, Name, Category, Price.ToString(), Quantity.ToString());
        }
    }
}
